from django.db import models

from prj002.models.models import CreatTimeModel
from prj002.models.info import Info
from myuser.models import MyUser


class Bxray(CreatTimeModel):
    XING_CHOICE = (
        ('正常', '正常'),
        ('PCO （窦卵泡个数≥12个）', 'PCO （窦卵泡个数≥12个）')
    )
    info = models.OneToOneField(Info, on_delete=models.CASCADE, related_name='bxray')

    owner = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='prj002_bxray')

    zigong_chang = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='子宫长径', help_text='子宫长径')

    zigong_kuan = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='子宫宽径', help_text='子宫宽径')

    zigong_gao = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='子宫高径', help_text='子宫高径')

    zigong_jixing = models.BooleanField(default=False, blank=True, verbose_name='畸形', help_text='畸形')

    zigong_jixing_juti = models.CharField(null=True, blank=True, max_length=50, verbose_name='畸形具体形态', help_text='畸形具体形态')

    zigong_neimo = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='子宫内膜厚度', help_text='子宫内膜厚度')

    zigong_is_jiliu = models.BooleanField(default=False, blank=True, verbose_name='是否存在子宫肌瘤', help_text='是否存在子宫肌瘤')

    zigong_daxiaochang = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='最大子宫肌瘤的大小-长', help_text='最大子宫肌瘤的大小-长')

    zigong_daxiaokuan = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='最大子宫肌瘤的大小-宽', help_text='最大子宫肌瘤的大小-宽')

    zigong_daxiaogao = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='最大子宫肌瘤的大小-高', help_text='最大子宫肌瘤的大小-高')

    zigong_xainji = models.BooleanField(default=False, blank=True, verbose_name='是否有子宫腺肌症', help_text='是否有子宫腺肌症')

    zuo_chang = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='左卵巢长径', help_text='左卵巢长径')

    zuo_kuan = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='左卵巢宽径', help_text='左卵巢宽径')

    zuo_qianhou = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='左卵巢高径', help_text='左卵巢高径')

    zuo_tiji = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True, verbose_name='左卵巢体积', help_text='左卵巢体积')

    zuo_nangzhong = models.BooleanField(default=False, blank=True, verbose_name='左卵巢是否有直径>10mm的囊肿', help_text='左卵巢是否有直径>10mm的囊肿')

    zuo_daxiaochang = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='左卵巢最大囊肿大小-长', help_text='左卵巢最大囊肿大小-长')

    zuo_daxiaokuan = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='左卵巢最大囊肿大小-宽', help_text='左卵巢最大囊肿大小-宽')

    zuo_daxiaogao = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='左卵巢最大囊肿大小-高', help_text='左卵巢最大囊肿大小-高')

    zuo_xingtai = models.CharField(max_length=50, choices=XING_CHOICE, null=True, blank=True, verbose_name='左卵巢形态', help_text='左卵巢形态')

    zuo_paoshu = models.IntegerField(null=True, blank=True, verbose_name='左卵巢窦卵泡数', help_text='左卵巢窦卵泡数')

    you_chang = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='右卵巢长径', help_text='右卵巢长径')

    you_kuan = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='右卵巢宽径', help_text='右卵巢宽径')

    you_qianhou = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='右卵巢高径', help_text='右卵巢高径')

    you_tiji = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True, verbose_name='右卵巢体积', help_text='右卵巢体积')

    you_nangzhong = models.BooleanField(default=False, blank=True, verbose_name='右卵巢是否有直径>10mm的囊肿', help_text='右卵巢是否有直径>10mm的囊肿')

    you_daxiaochang = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='右卵巢最大囊肿大小-长', help_text='右卵巢最大囊肿大小-长')

    you_daxiaokuan = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='右卵巢最大囊肿大小-宽', help_text='右卵巢最大囊肿大小-宽')

    you_daxiaogao = models.DecimalField(max_digits=10, decimal_places=1, null=True, blank=True, verbose_name='右卵巢最大囊肿大小-高', help_text='右卵巢最大囊肿大小-高')

    you_xingtai = models.CharField(max_length=50, choices=XING_CHOICE, null=True, blank=True, verbose_name='右卵巢形态', help_text='右卵巢形态')

    you_paoshu = models.IntegerField(null=True, blank=True, verbose_name='右卵巢窦卵泡数', help_text='右卵巢窦卵泡数')

    def __str__(self):
        return '%s-%s' % (self.pk, self.info)

    class Meta:
        verbose_name = '经阴道或经肛门B超'
        verbose_name_plural = verbose_name
